﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display {
    import flash.utils.*;
    import Display.DialogUI.*;
    import org.aswing.*;
    import Classes.*;
    import Display.aswingui.*;

    public class NotifyPopupView extends GenericDialogView {

        public static const STATE_LONG:int = 0;
        public static const STATE_SHORT:int = 1;

        protected var m_state:int;
        protected var m_tip:AssetPane;

        public function NotifyPopupView(_arg1:Dictionary, _arg2:String="", _arg3:String="", _arg4:int=0, _arg5:Function=null){
            super(_arg1, _arg2, _arg3, _arg4, _arg5);
            this.m_state = STATE_LONG;
        }
        override protected function init():void{
            m_bgAsset = m_assetDict["bgAsset"];
            this.makeBackground();
            this.makeCenterPanel();
            ASwingHelper.prepare(this);
        }
        override protected function makeBackground():void{
            var _local1:MarginBackground;
            if (m_bgAsset){
                _local1 = new MarginBackground(m_bgAsset);
                this.setBackgroundDecorator(_local1);
            };
        }
        override protected function makeCenterPanel():void{
            this.setBackgroundDecorator(new AssetBackground(m_bgAsset));
            var _local1:JPanel = ASwingHelper.makeSoftBoxJPanelVertical();
            _local1.append(ASwingHelper.verticalStrut(5));
            switch (this.m_state){
                case STATE_LONG:
                    _local1.append(this.makeLongPanel());
                    break;
                case STATE_SHORT:
                    _local1.append(this.makeShortPanel());
                    break;
            };
            _local1.append(ASwingHelper.verticalStrut(10));
            ASwingHelper.prepare(_local1);
            this.appendAll(ASwingHelper.horizontalStrut(5), _local1, ASwingHelper.horizontalStrut(5));
            ASwingHelper.prepare(this);
        }
        protected function makeLongPanel():JPanel{
            return (this.makeShortPanel());
        }
        protected function makeShortPanel():JPanel{
            var _local1:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.TOP, -2);
            this.m_tip = ASwingHelper.makeMultilineText(m_message, m_bgAsset.width, EmbeddedArt.DEFAULT_FONT_NAME_BOLD, "left", 10, 7715292);
            _local1.appendAll(this.m_tip, ASwingHelper.verticalStrut(22));
            ASwingHelper.prepare(_local1);
            return (_local1);
        }
        public function rebuild(_arg1:int):void{
            this.m_state = _arg1;
            this.removeAll();
            this.makeCenterPanel();
            ASwingHelper.prepare(this.parent);
        }

    }
}//package Display 
